from Page.auto_login_page import *
import unittest


class AutoLoginCase(unittest.TestCase):
    def setUp(self):
        self.driver = open_op_browser(path)
        self.ap = AutoLoginPage(self.driver)
        self.ap.open_url(login_url)

    def tearDown(self):
        self.ap.close()

    def test_auto_login_case(self):
        try:
            self.user = self.ap.auto_login()
            self.assertTrue(self.user, msg="没有读取到用户名,用例不通过")
        except Exception as e:
            raise e


if __name__ == '__main__':
    unittest.main()
